package com.weixing.mall.provider.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.model.domain.JobLogs;
import com.weixing.mall.provider.service.IJobLogsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 定时任务 -执行日志表 前端控制器
 * </p>
 *
 * @author Small
 * @since 2020-05-09
 */
@RestController
@RequestMapping("job")
@Api(value = "定时任务",tags = "定时任务")
public class JobLogsController extends BaseController {

    @Autowired
    private IJobLogsService jobLogsService;
    /**
     * 获取任务执行日志列表
     *
     * @param params
     * @return
     */
    @ApiOperation(value = "日志列表")
    @GetMapping(value = "logs")
    public Result getJobLogList(@RequestParam(required = false) Map params) {
        IPage<JobLogs> result = jobLogsService.findListPage(initMpPage(),params);
        return ResultUtil.success(result);
    }
}
